# encoding: utf-8
class TransferenciasController < ApplicationController
	include TransferenciaService

	#
	#
	def new
		@transfer = Transferencia.new(:data => Date.today)
	end

	#
	#
	def commit
		transf_params = params[:transfer]
		
		@transfer = efetivar_transferencia(Transferencia.new(transf_params),
			current_usuario)
		
		if @transfer.errors.empty?
			redirect_to new_transferencia_path, :notice => "Transferencia realizada com sucesso."
		else
			render :new
		end
	end


end
